var seniority = new Vue({

    methods:{
        //积分排行
        getSeniorityIntegral:function () {
            axios.get('/admin/seniority/integral')
                .then(function (response) {
                    var sIntegral = response.data.data;
                    var str = "";
                    var i = 1;
                    $.each(sIntegral,function (index,obj) {
                       str += '<tr><td>'+ i++ +'</td><td>'+obj.user_name+'</td><td>'+obj.user_grade+'</td><td>'+obj.user_integral+'</td>';
                    });
                    $('#seniorityIntegral').html(str);
                })
                .catch(function (error) {
                    console.log(error);
                });
        },

        //热帖排行
        getSeniorityNewnumber:function () {
            axios.get('/admin/seniority/newnumber')
                .then(function (response) {
                    var sNewnumber = response.data.data;
                    var str = "";
                    var i = 1;
                    $.each(sNewnumber,function (index,obj) {
                        str += '<tr><td>'+ i++ +'</td><td>'+obj.post_title+'</td><td>'+obj.forum_name+'</td><td>'+obj.user_name+'</td><td>'+obj.post_likes+'</td><td>'+obj.post_cnums+'</td>';
                    });
                    $('#seniorityNum').html(str);
                })
                .catch(function (error) {
                    console.log(error);
                });
        },

        //帖数排行
        getSenioritySumnumber:function () {
            axios.get('/admin/seniority/sumnumber')
                .then(function (response) {
                    var sSumnumber = response.data.data;
                    var str = "";
                    var i = 1;
                    $.each(sSumnumber,function (index,obj) {
                        str += '<tr><td>'+ i++ +'</td><td>'+obj.user_name+'</td><td>'+obj.nums_post+'</td><td>'+obj.sums_post+'</td>';
                    });
                    $('#senioritySum').html(str);
                })
                .catch(function (error) {
                    console.log(error);
                });
        },




    }
});